/**
 * @param {string} sentence
 * @return {string}
 */
 var toGoatLatin = function(sentence) {
  return sentence.split(' ').map((w, i) => `${(['a', 'A', 'e', 'E', 'i', 'I', 'o', 'O', 'u', 'U'].includes(w[0]) ? w : w.slice(1) + w[0])}ma${'a'.repeat(i + 1)}`).join(' ');
};